<%@ page import="njust.edu.web.SalaryOpe" %>
<%@ page import="njust.edu.web.UserSalary" %><%--
  Created by IntelliJ IDEA.
  User: 86138
  Date: 2021/9/18
  Time: 19:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>


<html>
<head>
    <title>查看业绩</title>
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
    <script src="${pageContext.request.contextPath}/sources/bootstrap-3.3.4/js/jquery.min.js"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.css" rel="stylesheet">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
    <link rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css">
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script type="text/javascript">
        $(function() {
            $( '#date-m' ).datepicker({
                dateFormat:"yy-mm-dd",
                forceParse: 0,
                showButtonPanel:true
            })
            //$('#datepicker').datepicker('setStartDate', '2021-09-17');

            $('#date-m').change(
                function() {
                    var date = $('#date-m').val();
                    window.location.href = "UserController?method=toSalaryUI&date="+ date;
                });

        })
    </script>
    <script type="text/javascript">
        $(function() {
            $( '#date-m' ).datepicker({
                dateFormat:"yy-mm-dd",
                forceParse: 0,
                showButtonPanel:true
            })
            //$('#datepicker').datepicker('setStartDate', '2021-09-17');

            $('#date-m').change(
                function() {
                    var date = $('#date-m').val();
                    window.location.href = "UserController?method=toSalaryUI&date="+ date;
                });

        })
    </script>
    <style>

        p{
            font-family:georgia;
            font-weight: 200;
        }

        .header {
            font-size: 94%;
            opacity: 0.8;
            position: absolute;
            top: 0;
            width: 100%;
            height: 80px;
        }
        .header ul {
            list-style-type: none;
            background-color: #333;
            margin: 0;
            padding: 0;
            overflow: hidden;
            width: 100%;
            height: 80px;
        }

        .header li {
            float: left;
            height: 80px;
            width: 200px;
            font-size: 150%;
        }

        .header li a {
            display: block;
            color: white;
            text-align: center;
            padding: 30px;
            text-decoration: none;
            height: 80px;
        }
        .header li a:hover:not(.active) {
            background-color: #111;
        }
        .container{
            left: 400px;
            position:absolute;
            width:1500px;
            height:1100px;
            top:80px;
            align-self: center;
            background-color: 	#dddce4;
            opacity: 0.8;
        }




    </style>

</head>
<body>
<div class = "backGround" style="position: relative;">
    <img src = "../img/salary.jpg" width="2402px" height="1202px">
<div class="header">
    <ul>
        <li><a href="BookController?method=itemManageUI"><p>管理菜品</p></a></li>
        <li><a href="TradeController?method=toTradeManageUI"><p>查看订单</p></a></li>
        <li><a href="UserController?method=toFinanceUI"><p>查看营业额</p></a></li>
        <li><a href="UserController?method=toSalaryUI" ><p>查看业绩</p></a></li>
        <li style="float: right"><a href="index.jsp" ><p>退出登录</p></a></li>
    </ul>
</div>

<%--<div class="col-md-10">--%>
<div class="container">
    <div class="panel panel-default">
        <div class="panel-heading">
            <div class="row">
                <div class="col-md-4">
                        <input class="form-control" id="date-m" type="text"
                               value="${(salary_date == null)?'请选择日期':salary_date_f }"
                               readonly>
                    <input type="hidden" id="dtp_input2" value="" />
                </div>
            </div>
        </div>

        <div class="panel-body">
            <table class="table table-striped book-manage table-hover">
                <tr>
                    <th>账户</th>
                    <th>姓名</th>
                    <th>当日业绩</th>
                    <th>当月业绩</th>
                </tr>
                <%
                    SalaryOpe salaryOpe;
                    salaryOpe=(SalaryOpe) request.getAttribute("salaryOpe");
                    if(salaryOpe!=null){

                    //System.out.println(salaryOpe.getUserSalaryList());
                    for (UserSalary userSalary:salaryOpe.getUserSalaryList()){
                %>
                <tr>
                <td><%=userSalary.getId()%></td>
                <td><%=userSalary.getName()%></td>
                <td><%=userSalary.getDayGet()%></td>
                <td><%=userSalary.getMonthGet()%></td>
                </tr>
            <%}
                    }
                    %>

            </table>

<%--            分页--%>
            <nav class="text-center">
                <ul class="pagination">
                    <li class=" ${salaryOpe.userPage.hasPrev == true?"":"disabled"}"><a
                            href="UserController?method=toSalaryUI&pageNo=1"> <span
                            aria-hidden="true">首页</span> </a>
                    </li>

                    <li class=" ${salaryOpe.userPage.hasPrev == true?"":"disabled"}"><a
                            href="UserController?method=toSalaryUI&pageNo=${salaryOpe.userPage.prevPage }"
                            aria-label="Previous"> <span aria-hidden="true">&laquo;上一页</span>
                    </a>
                    </li>

                    <li class="disabled"><a>第 ${salaryOpe.userPage.pageNo } 页 共
                        ${salaryOpe.userPage.totalPageNumber } 页</a>
                    </li>
                    <li class=" ${salaryOpe.userPage.hasNext == true?"":"disabled"}"><a
                            href="UserController?method=toSalaryUI&pageNo=${salaryOpe.userPage.nextPage}"
                            aria-label="Next"> <span aria-hidden="true">下一页&raquo;</span>
                    </a>
                    </li>
                    <li class=" ${salaryOpe.userPage.hasNext == true?"":"disabled"}"><a
                            href="UserController?method=toSalaryUI&pageNo=${salaryOpe.userPage.totalPageNumber}">
                        <span aria-hidden="true">末页</span> </a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
<%--</div>--%>
</div>
</div>
</body>
</html>
